C#: Fix CFG for unknown expressions#11
Conversation
calumgrant
commented
Aug 3, 2018
- Fix the CFG for unknown expressions, which were previously excluded from the control flow graph, which could lead to an incomplete graph.
- Add a test for this change, and also test the extraction of initializer-lists with unknown expressions. This test will currently fail on this branch as it tests extractor changes.
8e311a2 to
3658185
Compare
| * Returns the `i`th child of an expression, with | ||
| * children ranked from 0. | ||
| */ | ||
| private ControlFlowElement getRankedExprChild(Expr e, int i) { |
There was a problem hiding this comment.
I would change the name to getUnknownExprChild to match the other helper predicates, and perhaps remove the QL doc.
| * Returns the `i`th child of an expression, with | ||
| * children ranked from 0. | ||
| */ | ||
| private ControlFlowElement getRankedExprChild(Expr e, int i) { |
There was a problem hiding this comment.
Change Expr e to @unknown_expr, otherwise we will be computing the relation for all expressions, rather than just the unknown expressions.
| * have a valid `toString()`. | ||
| */ | ||
| class UnknownCall extends MethodCall | ||
| { |
| @@ -0,0 +1,18 @@ | |||
| import csharp | |||
There was a problem hiding this comment.
Add a
/**
* @kind graph
* @id cfg
*/
header; then we will be able to see the visualized graph in the IDE.
There was a problem hiding this comment.
Should be removed again, sorry.
4c5436e to
ff44772
Compare
|
@calumgrant : Should this go into 1.18? |
|
It should be in sync with the corresponding changes in Semmle/code (https://git.semmle.com/Semmle/code/pull/26692), so yes. I'll rebase, but it will conflict with #163. |
…object initializer lists fixed by the extractor.
ff44772 to
ecb3efb
Compare
|
Does this need a change note, or doesn't the change affect existing users? |
Java/Kotlin: Enhance 'compilations' support
feat(composite-actions): Fix summary and source queries for composite actions analysis